/* Query #1: Outputs the names of all actors in the movie "Die Another Day"*/
use CS143

SELECT	Actor.first, Actor.last 
FROM 	Actor INNER JOIN (Movie INNER JOIN MovieActor ON Movie.id = MovieActor.mid) ON Actor.id = MovieActor.aid  
WHERE 	(Movie.title ="Die Another Day"); 


/* Query #2: Output the names of all actors who act in multiple  movies */

SELECT	Actor.first, Actor.last 
FROM 	Actor INNER JOIN (Movie INNER JOIN MovieActor ON Movie.id = MovieActor.mid) ON Actor.id = MovieActor.aid  
GROUP BY Actor.id
HAVING  (Count(Movie.title)>1);


/*Query #3: Output the names of all directors who direct less than 3 movies */

SELECT	Director.first, Director.last 
FROM 	Director INNER JOIN (Movie INNER JOIN MovieDirector ON Movie.id = MovieDirector.mid) ON Director.id = MovieDirector.did  
GROUP BY Director.id
HAVING  (Count(Movie.title)<3); 

